package com.junchao.peng.controller;

import com.junchao.peng.pojo.MeetRoom;
import com.junchao.peng.service.MeetRoomService;
import com.junchao.peng.utils.JsonResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author dell
 */
@RestController
@RequestMapping("/meetRoom")
public class MeetRoomController {
    @Resource
    MeetRoomService meetRoomService;

    @ApiOperation("按主键删除")
    @DeleteMapping("/deleteByPrimaryKey")
    public JsonResult deleteByPrimaryKey(Integer id, String token){
        return meetRoomService.deleteByPrimaryKey(id, token);
    }

    @ApiOperation("新建会议室")
    @PostMapping("/insert")
    public JsonResult insert(MeetRoom record, String token){
        return meetRoomService.insert(record, token);
    }

    @ApiOperation("新建会议室 选择性入参")
    @PostMapping("/insertSelective")
    public JsonResult insertSelective(MeetRoom record, String token){
        return meetRoomService.insertSelective(record, token);
    }

    @ApiOperation("根据主键id查询会议室")
    @GetMapping("/selectByPrimaryKey")
    public JsonResult selectByPrimaryKey(Integer id, String token){
        return meetRoomService.selectByPrimaryKey(id, token);
    }

    @ApiOperation("获取会议室列表")
    @GetMapping("/listMeetRoom")
    public JsonResult listMeetRoom(String token){
        return meetRoomService.listMeetRoom(token);
    }

    @ApiOperation("根据主键选择性修改")
    @PutMapping("/updateByPrimaryKeySelective")
    public JsonResult updateByPrimaryKeySelective(MeetRoom record, String token){
        return meetRoomService.updateByPrimaryKeySelective(record, token);
    }

    @ApiOperation("根据主键全部修改")
    @PutMapping("/updateByPrimaryKey")
    public JsonResult updateByPrimaryKey(MeetRoom record, String token){
        return meetRoomService.updateByPrimaryKey(record, token);
    }
}
